package top.aicey.ai.sparring.common.holder;

import top.aicey.ai.sparring.dto.model.BaseRequestHeader;

public class RequestHeaderHolder {
    private static final ThreadLocal<BaseRequestHeader> requestHolder = new ThreadLocal();

    public RequestHeaderHolder() {
    }

    public static final BaseRequestHeader getRequestHeader() {
        if (requestHolder.get() == null) {
            setRequestHeader(new BaseRequestHeader());
        }

        return (BaseRequestHeader)requestHolder.get();
    }

    public static final void setRequestHeader(BaseRequestHeader requestHeader) {
        requestHolder.set(requestHeader);
    }
}
